package io.finer.erp.jeecg.bas.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import io.finer.erp.jeecg.bas.dto.InventoryDTO;
import io.finer.erp.jeecg.bas.dto.MaterialContrastDTO;
import io.finer.erp.jeecg.bas.entity.BasMaterialLog;
import io.finer.erp.jeecg.bas.vo.BasMaterialLogVO;

/**
 * @Description: PDA物料盘点记录
 * @Author: jeecg-boot
 * @Date:   2021-05-11
 * @Version: V1.0
 */
public interface BasMaterialLogMapper extends BaseMapper<BasMaterialLog> {

	/**
	 * @Description 根据物料id查记录信息 
	 * @param id
	 * @return
	 * Create at: 2021-05-11 17:55:16
	 * @author: xzs
	 * Revision:
	 *    2021-05-11 17:55:16 - first revision by xzs
	 *
	 */
	@Select("SELECT * FROM bas_material_log WHERE material_id=#{id}")
	BasMaterialLog selectBasMaterialLog(String id);
	
	/**
	 * @Description 查询所有记录物料id
	 * @return
	 * Create at: 2021-05-12 10:20:48
	 * @author: xzs
	 * Revision:
	 *    2021-05-12 10:20:48 - first revision by xzs
	 *
	 */
	@Select("SELECT code FROM bas_material_log")
	List<String> selectMaterialCodeList();
	
	
	/**
	 * @Description 查询实时库存物料对比信息
	 * @param vo
	 * @return
	 * Create at: 2021-08-20 16:10:59
	 * @author: xzs
	 * Revision:
	 *    2021-08-20 16:10:59 - first revision by xzs
	 *
	 */
	List<MaterialContrastDTO> getContrastDTOList(@Param("vo")BasMaterialLogVO vo);
	
	/**
	 * @Description 此处查询实时库存数据
	 * @param vo
	 * @return
	 * Create at: 2021-08-20 10:59:21
	 * @author: xzs
	 * Revision:
	 *    2021-08-20 10:59:21 - first revision by xzs
	 *
	 */
	public IPage<InventoryDTO> getInventory(@Param("vo")BasMaterialLogVO vo, Page<InventoryDTO> page);
	
	public List<InventoryDTO> getInventorySum(BasMaterialLogVO vo);
}
